import type { IForm } from "/@/base-ui/form/types";

export const modalConfig: IForm = {
  formItems: [
    {
      field: "costTypeCode",
      label: "费用名称",
      type: "select",
      placeholder: "请选择",
      options: [],
      otherOptions: {
        required: true
      }
    },
    {
      field: "costAmount",
      label: "费用金额（元）",
      type: "inputNumber",
      placeholder: "请输入",
      otherOptions: {
        required: true
      },
      childrenProps: {
        controls: false,
        style: {
          width: "100%"
        }
      }
    },
    {
      field: "chargeCompany",
      label: "收费单位",
      type: "input",
      placeholder: "请输入",
      otherOptions: {
        required: true
      }
    },
    {
      field: "costTime",
      type: "datepicker",
      label: "费用产生日期",
      labelWidth: "110px",
      placeholder: "请选择",
      otherOptions: {
        type: "date",
        required: true
      }
    },
    {
      field: "attachment",
      type: "upload",
      label: "附件",
      slotName: "uploadSlot"
    },
    {
      field: "isShareTransfer",
      type: "radio",
      label: "是否已分摊转固",
      placeholder: "请选择",
      options: [
        { label: "是", value: "1" },
        { label: "否", value: "0" }
      ],
      otherOptions: {
        required: true
      }
    },
    {
      field: "remark",
      label: "备注",
      type: "input",
      placeholder: "请输入",
      childrenProps: {
        type: "textarea"
      },
      otherOptions: {}
    }
  ],
  rules: {
    costTypeCode: [
      {
        required: true,
        message: "请选择费用名称",
        trigger: ["change", "blur"]
      }
    ],
    costAmount: [
      { required: true, message: "请输入费用金额", trigger: ["change", "blur"] }
    ],
    chargeCompany: [
      { required: true, message: "请输入收费单位", trigger: ["change", "blur"] }
    ],
    costTime: [
      {
        required: true,
        message: "请选择费用产生日期",
        trigger: ["change", "blur"]
      }
    ],
    isShareTransfer: [
      { required: true, message: "请选择是否已分摊转固", trigger: "change" }
    ]
  },
  colLayout: {
    span: 24
  },
  labelWidth: "122px",
  itemStyle: {}
};
